package com.victor9ac.tfm.mashup.endpoint;


import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.victor9ac.mashup.usecase.CommentUseCase;
import com.victor9ac.mashup.usecase.ImageUseCase;





@Component
@Path("mashup")
public class MashupServiceEndpoint {
    

	@Autowired
	CommentUseCase commentUseCase;
	@Autowired
	ImageUseCase imageUseCase;


	@GET
    @Path("/comments/{key}")
    @Produces(MediaType.APPLICATION_JSON)
    public Object getIt(@PathParam("key") String keyword) { 	
    	return  commentUseCase.getCommentsWithoutAnyFilter(keyword);
    }
	
	@GET
    @Path("/images/{key}")
    @Produces(MediaType.APPLICATION_JSON)
    public Object getImgs(@PathParam("key") String keyword) { 	
    	return  imageUseCase.getMainImagesByKeyword(keyword);
    }
	
	

    public void setCommentUseCase(CommentUseCase commentUseCase) {
		this.commentUseCase = commentUseCase;
	}
	public void setImageUseCase(ImageUseCase imageUseCase) {
		this.imageUseCase = imageUseCase;
	}



}
